<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function f1(){
				alert("网页即将跳转")
			}
			function f2(){
				let ans=confirm("你确定要跳转吗")
				if(ans==true){
					location.href="https://www.pzhu.cn"
				}
			}
			function f3(){
				let ans=prompt("请输入网址：","https://www.pzhu.cn")
				if(ans){ //ans不为空
					location.href=ans
				}
				
			}
		</script>
	</head>
	<body>
		<button type="button" onclick="f1()">即将跳转</button>
		<button type="button" onclick="f2()">确认是否跳转</button>
		<button type="button" onclick="f3()">自定义跳转</button>
	</body>
</html>
